batch source
------------
       ,     ,       ...
     ...   ...
      ...

1.          ,       
      choice   !
    ,   debug        input...
@echo off
echo Type input:
FC con nul /lb1 /n |FIND "1:" > %temp%.\t1.bat
echo e102'set %%1='> %temp%.\t2.dat
for %%? in (w q) do echo %%?>> %temp%.\t2.dat
DEBUG %temp%.\t1.bat < %temp%.\t2.dat > nul
call %temp%.\t1.bat INPUT
for %%? in (t1.bat t2.dat) do del %temp%.\%%?
echo INPUT=%INPUT%

    ...  ...
"     ....  :

2.  ,   ...

@echo off
if "%1"=="GoTo" goto %2
:: Open a child shell to get more enviroment space.
:: This is also good because we don't need to unSET
:: variables at the end:
%comspec% /e:4096 /c %0 GoTo start
goto eof
:start
:: Temporary files table - use only .bat extentions
SET T1=%TEMP%.\TEMP1.BAT
SET T2=%TEMP%.\TEMP2.BAT
SET F1=%TEMP%.\TEMP3.BAT
SET F2=%TEMP%.\TEMP4.BAT
:: Create temporary work files
echo e102'set %%1='> %F1%
for %%? in (w q) do echo %%?>> %F1%
echo @PROMPT Invalid input. Invalid characters: $Q $L $G $B$_> %T1%
%comspec% /e:4096 /c %T1% > %T2%
FIND ":" < %T2% > %F2%
echo.
echo First name:
:: Get user input and save on %FNAME%
call %0 GoTo input fname
echo.
echo Middle name (note that this one may be blank)
:: Get user input and save on %MNAME%
:: Note that this input may be blank, so the /b switch is used
call %0 GoTo input mname /b
echo.
echo Last name:
:: Get user input and save on %LNAME%
call %0 GoTo input lname
echo.
echo Gender:
:: Get user input and save on %GENDER%
call %0 GoTo input gender
:: ECHO the variables. Note that these won't be
:: avaliable when the batch script terminates,
:: since this is being run on a child shell (when
:: the child shell is terminated, the variables
:: come back to their original state)
echo.
echo FNAME=%FNAME%
echo MNAME=%MNAME%
echo LNAME=%LNAME%
echo GENDER=%GENDER%
:: Delete temporary files
for %%? in (%T1% %T2% %F1% %F2%) do if exist %%? del %%?
goto eof
:: Subroutine syntax: call %0 GoTo: input varname [/b]
:: varname - variable to save input
:: /b      - lets input be blank
:input
FC con nul /lb1 /n > %T2%
FIND "1:" < %T2% > %T1%
FIND "|" < %T1% > nul
if not errorlevel=1 goto input_e1
FIND "<" < %T1% > nul
if not errorlevel=1 goto input_e1
FIND ">" < %T1% > nul
if not errorlevel=1 goto input_e1
FIND "=" < %T1% > nul
if not errorlevel=1 goto input_e1
DEBUG %T1% < %F1% > nul
call %T1% _
if not "%4"=="/b" if "%_%"=="" goto input_e2
set %3=%_%
set _=
goto eof
:input_e1
type %F2%
goto input
:input_e2
echo Invalid input. Input may not be blank.
goto input
:eof

 ...

3.   :)    ...'       ,  
     '...     !    :

:: Get a random number (00-99)
:: The number is actually the seconds' cents
@echo off
echo @PROMPT $T$_> %temp%.\t1.bat
%comspec% /c %temp%.\t1.bat > %temp%.\t2.bat
echo e104'set %%1='> %temp%.\t1.bat
for %%? in (f100L4''20 w q) do echo %%?>> %temp%.\t1.bat
DEBUG %temp%.\t2.bat < %temp%.\t1.bat > nul
call %temp%.\t2.bat RANDOM
for %%? in (t1.bat t2.bat) do del %temp%.\%%?
echo RANDOM=%RANDOM%

"    ...
     ,   ...
     random.

4. ...      !    :)
     005   137   ,   :)...   !
  :

@echo off
if "%1"=="GoTo" goto %2
:: 000 - 999 version (fixed digit length)
:: Set START less than STOP less than or equal to 999
:: You MUST include trailing zeroes on the left, so that
:: START and STOP are 3-digit long
set START=005
set STOP=137
call %0 GoTo count1
set N=
goto eof
:count1
if "%STOP%"=="" goto eof
if not "%5"=="" goto count2
for %%? in (0 1 2 3 4 5 6 7 8 9) do call %0 GoTo count1 %3 %4 %%?
goto eof
:count2
set N=%3%4%5
if "%N%"=="%START%" set START=
if not "%START%"=="" goto eof
:: %N% represents the current number count
echo N=%N%
if "%N%"=="%STOP%" set STOP=
:eof

5.  4        ...   24   137 ...  !

@echo off
if "%1"=="GoTo" goto %2
:: 0 - 999 version
:: Set START less than STOP less than or equal to 999
:: Do NOT include trailing zeroes on the left
set START=24
set STOP=137
call %0 GoTo count1
set N=
goto eof
:count1
if "%STOP%"=="" goto eof
if not "%5"=="" goto count2
for %%? in (0 1 2 3 4 5 6 7 8 9) do call %0 GoTo count1 %3 %4 %%?
goto eof
:count2
set N=%3%4%5
if "%3"=="0" set N=%4%5
if "%3%4"=="00" set N=%5
if "%N%"=="%START%" set START=
if not "%START%"=="" goto eof
:: %N% represents the current number count
echo N=%N%
if "%N%"=="%STOP%" set STOP=
:eof

6. delay ...

echo Waiting (type "q" to quit) ...
CHOICE /c:q /t:,60 /n > nul
::        ^-----^-- odd "delayed exit" character
if errorlevel=2 goto exit
echo 60 seconds have passed!
:exit
echo End of example

     :)

 ,   ,  !
d4rk-W